<template>
	<view class="grid">
		<view class="grid-item" :style="{width:itemWidth}" v-for="(item,index) in gridData" :key="index">
			<summary-item :item="item"></summary-item>
		</view>
	</view>
</template>

<script>
	import SummaryItem from './SummaryItem';
	export default {
		components: {
			SummaryItem
		},
		props: {
			column: { //默认一行3列
				type: Number,
				default: 3
			},
			gridData: {
				type: Array,
				default () {
					return []
				}
			}
		},
		computed: {
			itemWidth() {
				return (100 / this.column) + "%";
			},

		},

	}
</script>

<style lang="scss" scoped>
	.grid {
		background-image: url(/static/report/summary_bg.jpg);
		background-color: #5ea1f8;
		border-radius: 8upx;
		background-size: 100% 100%;

		&-item {
			display: inline-block;
		}
	}
</style>
